/**  
 * All rights Reserved
 * @Title:  RestController.java   
 * @Package com.joseph.controller   
 * @Description:    TODO   
 * @author: Joseph Gao     
 * @date:   2018年11月27日 下午10:26:08   
 * @version V1.0 
 * @Copyright: 2018 All rights reserved. 
 */
package com.joseph.controller;

import org.springframework.web.bind.annotation.*;
import com.joseph.common.Result;
import com.joseph.entity.User;
import org.springframework.http.MediaType;

/** 
* 
*
* @author Joseph
* @date 2018年11月27日
*/
@RestController
@RequestMapping(value="/rest", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
public class RestTestController {

	/** 
	* <p>Title: </p> 
	* <p>Description: </p>  
	*/
	public RestTestController() {
		
	}

	@RequestMapping(value = "/id/{id}", method = RequestMethod.GET)
	public @ResponseBody Result get(@PathVariable Integer id){
		User user = new User();
		user.setId(id);
		user.setAge(id*2);
		user.setPassword("password");
		user.setUserName("zhangsan");
		return Result.success(user);
	}
}
